package com.fdd.op.sdk.request.api.verify.company;

import com.fdd.op.sdk.ApiRuleException;
import com.fdd.op.sdk.BaseFddRequest;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.mapping.RequestField;
import com.fdd.op.sdk.internal.util.StringUtils;
import com.fdd.op.sdk.model.dto.BankCardDTO;
import com.fdd.op.sdk.response.api.verify.company.ChangeResponse;

import java.util.Map;

public class ChangeRequest extends BaseFddRequest<ChangeResponse> {
    @Override
    public String getApiMethodName() {
        return "/user/api/verify/company/change";
    }

    @Override
    public Map<String, Object> getTextParams() {
        return null;
    }

    @Override
    public Class<ChangeResponse> getResponseClass() {
        return ChangeResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
        if(StringUtils.isBlank(getCompanyName())){
            throw new ApiRuleException("2", "参数验证失败，companyName,企业名称不能传空");
        }
        if(getVerifiedWay() == null){
            throw new ApiRuleException("2", "参数验证失败，verifiedWay,企业认证方案不能传空");
        }
        if(StringUtils.isBlank(getNotifyUrl())){
            throw new ApiRuleException("2", "参数验证失败，notifyUrl,异步通知地址不能为空");
        }
    }

    @Override
    public String getHttpMethod() {
        return Constants.METHOD_POST;
    }

    @RequestField
    private String companyId;

    @RequestField
    private String tpOrgId;

    @RequestField
    private String companyName;

    @RequestField
    private Integer verifiedWay;

    @RequestField
    private BankCardDTO bankCardDTO;

    @RequestField
    private Integer applicationType;

    @RequestField
    private String accountId;

    @RequestField
    private String tpAccountId;

    @RequestField
    private String notifyUrl;

    @RequestField
    private String returnUrl;

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getTpOrgId() {
        return tpOrgId;
    }

    public void setTpOrgId(String tpOrgId) {
        this.tpOrgId = tpOrgId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public Integer getVerifiedWay() {
        return verifiedWay;
    }

    public void setVerifiedWay(Integer verifiedWay) {
        this.verifiedWay = verifiedWay;
    }

    public BankCardDTO getBankCardDTO() {
        return bankCardDTO;
    }

    public void setBankCardDTO(BankCardDTO bankCardDTO) {
        this.bankCardDTO = bankCardDTO;
    }

    public Integer getApplicationType() {
        return applicationType;
    }

    public void setApplicationType(Integer applicationType) {
        this.applicationType = applicationType;
    }

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public String getTpAccountId() {
        return tpAccountId;
    }

    public void setTpAccountId(String tpAccountId) {
        this.tpAccountId = tpAccountId;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getReturnUrl() {
        return returnUrl;
    }

    public void setReturnUrl(String returnUrl) {
        this.returnUrl = returnUrl;
    }
}
